package com.example.factorymethod;

import com.example.factorymethod.factory.Fruit;
import com.example.factorymethod.factory.FruitFactory;

/**
 * @version 1.0.0
 * @className: Test
 * @description:
 * @author: zhangjunfa
 * @date: 2022/6/10 14:11
 */
public class Test {
    public static void main(String[] args) {
        FruitFactory factory;
        Fruit fruit;
        //也可以引入配置文件和反射机制实现
        factory = new OrangeFruitFactory();
        fruit = factory.createFruit();
        fruit.eatFruit();
    }
}
